package com.mrd.gtimp.business.entity;

import org.hibernate.annotations.GenericGenerator;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

/**
 * Created by dark on 17/7/10.
 */

/**
 * 查验内容，包含单个柜需要查验的项目和查验单位
 */
@Entity(name = "T_BIZ_DECLA_CHECK_CONTENT")
public class DeclaCheckContent implements Serializable {
    /**
     * 编号
     */
    @Id
    @GeneratedValue(generator = "paymentableGenerator")
    @GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
    @Column(name = "ID")
    private String id;
    /**
     * 柜号
     */
    @Column(name = "CONTAINER_NO")
    private String containerNo;

    /**
     * 查验跟踪
     */
    @ManyToOne
    @JoinColumn(name = "TRACKING_ID")
    private DeclaCheckTracking declaCheckTracking;

    /**
     * 创建者
     */
    @Column(name = "CREATOR")
    private String creator;

    /**
     * 创建时间
     */
    @Column(name = "CREATE_TIME")
    private Date createTime;

    /**
     * 状态
     */
    @Column(name = "STATUS")
    private String status;

    /**
     * 其他查验单位
     */
    @Column(name = "OTHER_INSPECT_DEPT")
    private String otherInspectDept;

    /**
     * 查验单位关联数据字典
     */
    @ManyToMany
    @JoinTable(name = "T_BIZ_DECLA_CHECK_CT_DEPT_REF", joinColumns = @JoinColumn(name = "CONTENT_ID"),
            inverseJoinColumns = @JoinColumn(name = "ITEM_ID"))
    private List<Dictionary> checkDeptList;

    /**
     * 查验项目关联数据字典
     */
    @ManyToMany
    @JoinTable(name = "T_BIZ_DECLA_CHECK_CT_ITEM_REF", joinColumns = @JoinColumn(name = "CONTENT_ID"),
            inverseJoinColumns = @JoinColumn(name = "ITEM_ID"))
    private List<Dictionary> checkItemList;

    /**
     * 查验商品关联数据字典
     */
    @ManyToMany
    @JoinTable(name = "T_BIZ_DECLA_CHECK_GOODS_REF", joinColumns = @JoinColumn(name = "CONTENT_ID"),
            inverseJoinColumns = @JoinColumn(name = "GOODS_ID"))
    private List<Dictionary> checkGoodsList;


    /**
     * 查验结果
     */
    @OneToMany(mappedBy = "declaCheckContent", cascade = CascadeType.ALL)
    private List<DeclaCheckResult> declaCheckResultList;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getContainerNo() {
        return containerNo;
    }

    public void setContainerNo(String containerNo) {
        this.containerNo = containerNo;
    }

    public DeclaCheckTracking getDeclaCheckTracking() {
        return declaCheckTracking;
    }

    public void setDeclaCheckTracking(DeclaCheckTracking declaCheckTracking) {
        this.declaCheckTracking = declaCheckTracking;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getOtherInspectDept() {
        return otherInspectDept;
    }

    public void setOtherInspectDept(String otherInspectDept) {
        this.otherInspectDept = otherInspectDept;
    }

    public List<Dictionary> getCheckDeptList() {
        return checkDeptList;
    }

    public void setCheckDeptList(List<Dictionary> checkDeptList) {
        this.checkDeptList = checkDeptList;
    }

    public List<Dictionary> getCheckItemList() {
        return checkItemList;
    }

    public void setCheckItemList(List<Dictionary> checkItemList) {
        this.checkItemList = checkItemList;
    }

    public List<Dictionary> getCheckGoodsList() {
        return checkGoodsList;
    }

    public void setCheckGoodsList(List<Dictionary> checkGoodsList) {
        this.checkGoodsList = checkGoodsList;
    }

    public List<DeclaCheckResult> getDeclaCheckResultList() {
        return declaCheckResultList;
    }

    public void setDeclaCheckResultList(List<DeclaCheckResult> declaCheckResultList) {
        this.declaCheckResultList = declaCheckResultList;
    }
}
